﻿using System;
using System.Collections.Generic;

using System.Text;
using Module.Common.Models;
using Module.Core.DAO.DAO;
using Module.Core.EntitiesInfo.TablesInfo;

namespace Module.Core.BusinessLogic.OnlineSupports
{
    public class OnlineSupportsBL
    {
        /// <summary>
        /// Saves a record to the OnlineSupports table.
        /// </summary>
        public static int Insert(OnlineSupportsInfo onlineSupportsInfo)
        {
            try
            {
                return new OnlineSupportsDAO().Insert(onlineSupportsInfo);
            }
            catch (Exception ex)
            {
                throw;
            }

        }

        /// <summary>
        /// Saves a record to the OnlineSupports table.
        /// </summary>
        public static void Update(OnlineSupportsInfo onlineSupportsInfo)
        {
            try
            {
                new OnlineSupportsDAO().Update(onlineSupportsInfo);
            }
            catch (Exception ex)
            {
                throw;
            }

        }

        /// <summary>
        /// Delete a record from the OnlineSupports table.
        /// </summary>
        public static void Delete(int onlineSupportsInfo)
        {
            try
            {
                new OnlineSupportsDAO().Delete(onlineSupportsInfo);
            }
            catch (Exception ex)
            {
                throw;
            }

        }

        /// <summary>
        /// Selects a single record from the OnlineSupports table.
        /// </summary>
        public static OnlineSupportsInfo Select(int onlineSupportsInfo)
        {
            try
            {
                return new OnlineSupportsDAO().Select(onlineSupportsInfo);
            }
            catch (Exception ex)
            {
                throw;
            }

        }

        /// <summary>
        /// Selects all records from the OnlineSupports table.
        /// </summary>
        public static CHRTList<OnlineSupportsInfo> SelectAll(int status)
        {
            try
            {
                return new OnlineSupportsDAO().SelectAll(status);
            }
            catch (Exception ex)
            {
                throw;
            }

        }
        public static CHRTList<OnlineSupportsInfo> SearchAll(string NickName, int status, int from, int to)
        {
            try
            {
                return new OnlineSupportsDAO().SearchAll(NickName, status, from, to);
            }
            catch (Exception ex)
            {
                throw;
            }

        }
        public static int GetCount(string NickName, int status)
        {
            try
            {
                return new OnlineSupportsDAO().GetCount(NickName, status);
            }
            catch (Exception)
            {

                throw;
            }
        }
	
    }
}
